package kz.kstu.shop.facade.ejb.impl;

import kz.kstu.shop.business.entity.Synchronizable;
import kz.kstu.shop.business.server.api.SyncService;
import kz.kstu.shop.facade.ejb.api.SyncFacade;

import javax.ejb.Stateless;
import java.util.List;

/**
 * @author Filipp_Stankevich
 *         created: 8/9/11 6:03 PM
 */
@Stateless
public class SyncFacadeBean extends AbstractFacadeBean implements SyncFacade{
    @Override
    public <T extends Synchronizable> List<Synchronizable> findForSync(Class<T> classForSync, Long changeDate) {
        return getSyncService().findForSync(classForSync, changeDate);
    }

    @Override
    public void saveSycnhronazable(List<Synchronizable> entities) {
        getSyncService().saveSycnhronazable(entities);
    }

    private SyncService getSyncService() {
        return getService(SyncService.class);
    }
}
